﻿using System;
using System.Globalization;
using System.Linq;
using System.Windows.Data;

namespace Labthink.PCSoft.UniversalHost4.Instrument.Converters
{
    public class TestTypeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var cl = Common.TestTypes.SingleOrDefault(l => l.LanguageId == parameter + "" + value);
            if (cl == null) return "" + value;
            return cl.Text;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }
    }
}
